# 列表练习
# 两个列表[1,5,7,9]和[2,2,6,8]合并为[1,2,2,3,6,7,8,9]
lst1 = [1, 5, 7, 9]
lst2 = [2, 2, 6, 8]
lst1.extend(lst2)

print(lst1)
lst1.sort(reverse=False)

print(lst1)
# 列表推导式
# 列表推导式求列表所有奇数并构造新列表，a =  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a = [i for i in a if i % 2 == 1]
print(a)
# 使用匿名函数lambda
b = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
b = list(filter(lambda i: i % 2 == 1, b))
print(b)
